package com.bw.jetpacktest.life;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bw.jetpacktest.R;

public class LifeActivity extends AppCompatActivity implements View.OnClickListener {

    private LifePresenter lifePresenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e("ZXY","LifeActivity->create()");
        setContentView(R.layout.activity_life);
        findViewById(R.id.finish_btn).setOnClickListener(this);
        lifePresenter = new LifePresenter();
        getLifecycle().addObserver(lifePresenter);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.e("ZXY","LifeActivity->onDestroy()");
        getLifecycle().removeObserver(lifePresenter);
    }

    @Override
    public void onClick(View view) {
        finish();
    }
}
